from redis import StrictRedis

class Config:
    #开启调试模式
    DEBUG = None

    SECRET_KEY = 'zauU3UIGxLbxuec9CYAmZm1S0nWf3509iKzN+tBPGDc88O/DBuw7BNTZeGHcf2vW'
    #配置sqlalchemy来接mysql数据库
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/test3'
    #配置数据库的动态追踪修改
    SQLALCHEMY_TRACK_MODIFICATIONS = False


    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    SESSION_TYPE = 'redis'
    SESSION_USE_SIGNER = True
    SESSION_REDIS = StrictRedis(host= REDIS_HOST,port= REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = 86400

class developmentConfig(Config):
    DEBUG = True


class productionConfig(Config):
    DEBUG = False

config = {
    'development': developmentConfig,
    'production': productionConfig
}